<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>{$head[title]}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta content="{$head[keywords]}" name="keywords" />
<meta content="{$head[description]}" name="description" />
<base href="{SITE_URL}" />
<link href="favicon.ico" rel="shortcut icon" />
<link href="../skin/style.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="{$head[title]}" href="/rss.php?rssid={$catid}" />
<script language="JavaScript" src="misc/config.js"></script>
<script language="JavaScript" src="misc/jquery.min.js"></script>
<script language="JavaScript" src="misc/common.js"></script>
<script language="JavaScript" src="misc/validator.js"></script>
</head>
<body>

{template 'header.html'}

<div class="container">

	
    <script language="JavaScript">
	function search_submit()
	{
		if($('#asktitle').val() =="")
		{
			$('#asktitle').focus();
			alert("请填写您要搜索的问题.");
			return false;
		}
		var keywords=$('#asktitle').val();
		redirect('{url("?module=ask&action=search&keywords='+keywords+'")}');
	}
	</script>
    <form name="wordform" action="{url("?module=ask&action=question")}" method="post">
        <input name="title" id="asktitle" type="text" style="width:260px;" />
        <input type="submit" value="我要提问" style="width:60px;" /> 
        <input type="button" value="搜索答案" name="search" onClick="search_submit();" style="width:60px;" />
	</form>

    <div class="main"> 
        
         <div class="head"><a href="{url("?module=ask&action=browse&type=nosolve")}"><img src="images/more.gif" alt="更多"/></a>待解决问题<span>({$nosolve_ques_count})</span></div>
         <ul> 
          {get sql="select * from table_ask where status=3 order by addtime desc" rows="5" page="$page"}
           <li> <a href="{url("?module=ask&action=view&id=$r[askid]")}" target="{$target}" title="{$r[title]}">{str_cut($r[title],100,'..')}</a> {if $showcatname} <a href="{$CATEGORY[$r[catid]][url]}" style="color:gray">[{$CATEGORY[$r[catid]][catname]}]</a>{/if}</li>
          {/get}
        </ul>
        
        
        
        <div class="head"><a href="{$M[url]}browse.php?action=solve"><img src="images/more.gif" alt="更多"/></a>已解决问题<span>({$solve_ques_count})</span></div>
         <ul> 
          {get sql="select * from table_ask where flag=0 order by addtime desc" rows="5" page="$page"}
            <li> <a href="{url("?module=ask&action=view&id=$r[askid]")}" target="{$target}" title="{$r[title]}">{str_cut($r[title],100,'..')}</a> {if $showcatname} <a href="{$CATEGORY[$r[catid]][url]}" style="color:gray">[{$CATEGORY[$r[catid]][catname]}]</a>{/if}</li>
          {/get}
        </ul>
        
            
     
    </div>
    
    <div class="aside">
    
        <div class="head"><a href="{url("?module=ask&action=question")}">我要提问</div>
        <div class="head">热点问题</div>
    	
        <ul> 
          {get sql="select * from table_ask order by hits desc" rows="5" page="$page"}
            <li> <a href="{url("?module=ask&action=view&id=$r[askid]")}" target="{$target}" title="{$r[title]}">{str_cut($r[title],100,'..')}</a> {if $showcatname} <a href="{$CATEGORY[$r[catid]][url]}" style="color:gray">[{$CATEGORY[$r[catid]][catname]}]</a>{/if}</li>
          {/get}
        </ul>
          
          
         <div class="head">推荐问题</div>
    	
        <ul> 
          {get sql="select * from table_ask where flag=3 order by addtime desc" rows="5" page="$page"}
            <li> <a href="{url("?module=ask&action=view&id=$r[askid]")}" target="{$target}" title="{$r[title]}">{str_cut($r[title],100,'..')}</a> {if $showcatname} <a href="{$CATEGORY[$r[catid]][url]}" style="color:gray">[{$CATEGORY[$r[catid]][catname]}]</a>{/if}</li>
          {/get}
        </ul>
        
        
        <div class="head">积分排行</div>
    	
        <ul> 
          {get sql="select * from table_ask_posts where status=-1 order by addtime desc" rows="5" page="$page"}
            <li><a href="{$MODULE[member][url]}view.php?userid={$r[userid]}">{$r[username]}</a> ({$r[point]}分) {actor($r[actortype],$r[point])} 回答数:{$r[answercount]}</li>
          {/get}
        </ul>
        
    </div>
</div>

<script language="JavaScript">
<!--
	function showContent(id)
	{
		for (var i = 0;i < 3;i++)
		{
		var nav = document.getElementById("nav" + i);
		var content = document.getElementById("content" + i);
			if (i == id)
			{
			nav.className = 'selected';
			content.style.display = "";
			}
			else
			{
			nav.className = '';        
			content.style.display = "none";
			}
		}
	}
	var modurl = '{$MODULE['ask']['url']}';
 //-->
</script>
<script type="text/javascript" src="{SITE_PATH}images/js/ask_search_json.js"></script>
{template 'footer.html'} 